package org.example.graphics;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.os.Bundle;
import android.view.View;

public class AndroidGraphics extends Activity {
	
	private static final String QUOTE = "This is testing circular pathing. Yay!";
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new GraphicsView(this));
        setBackgroundResource(R.drawable.background);
    }
    
    static public class GraphicsView extends View {
    	public GraphicsView(Context context) {
    		super(context);
    	}
    	@Override
    	protected void onDraw(Canvas canvas) {
    		Path circle = new Path();
    		Paint cPaint = new Paint();
    		Paint tPaint = new Paint();
    		cPaint.setColor(Color.LTGRAY);
    		tPaint.setColor(Color.BLACK);
    		circle.addCircle(150, 150, 100, Direction.CW);
    		canvas.drawPath(circle, cPaint);
    		canvas.drawTextOnPath(QUOTE, circle, 0, 20, tPaint);
    	}
    }
}